﻿@model List<Code_Type>
@{
    ViewBag.Title = "CodeAdd";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="main-container">
    <div class="modal-form">
        <div class="modal-form-body">
            <form id="Form" method="post" action="@Url.Action("UserAdd", "System")" class="form-horizontal margin10-t">
                <div class="contrl">
                    <label>类型号：</label>
                    <select name="Type_Code" class="select">
                        @foreach (Code_Type m in Model)
                        {
                            <option>@m.Type_Code</option>
                        }
                    </select>
                </div>
                <div class="contrl">
                    <label>码名称：</label>
                    @Html.TextBox("Data_Value", "", new { @class = "input" })
                </div>
                <div class="contrl">
                    <label>码号：</label>
                    @Html.TextBox("Data_Key", "", new { @class = "input" })
                </div>
                <div class="contrl">
                    <label>序号：</label>
                    @Html.TextBox("Data_Seq", "", new { @class = "input" })
                </div>
                <div class="contrl">
                    <label>分类：</label>
                    @Html.TextBox("Data_Type", "", new { @class = "input" })
                </div>
            </form>
        </div>
        <div class="modal-form-footer">
            <input type="button" class="btn-primary" value="保存" onclick="autoSubmit('System', 'CodeAdd', 'CodeList')" />
            <input type="button" class="btn-secondary" value="取消" onclick="CloseModelFrame()">
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#Form").validate({
            rules: {
                Type_Code: { required: true },
                Data_Value: { required: true },
                Data_Key: { required: true },
                Data_Seq: { required: true }
            },
            messages: {
                Type_Code: {
                    required: "请选择码类型",

                },
                Data_Value: {
                    required: "请输入码名称"
                },
                Data_Key: {
                    required: "请输入码号"
                },
                Data_Seq: {
                    required: "请输入序号"
                }
            },
            errorElement: "em"
        });
    });
</script>
